#include <iostream>
#include <cstring>
#include <cerrno>
#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
#include "udpclient.hpp"
int main(int argc, char* args[])
{
    if(argc != 3)
    {
        std::cout << "Usage: \n";
        std::cout << args[0] << " IP port\n";
        return 0;
    }
    uint16_t port = std::stoi(args[2]);
    struct sockaddr_in server;
    memset(&server, 0, sizeof(server));
    server.sin_family = AF_INET;
    server.sin_port = htons(port);
    server.sin_addr.s_addr = inet_addr(args[1]);
    UdpClient client;
    client.Init();
    client.Start(server);
    return 0;
}
